<?php //printdie($cobranza); ?>
<style type="text/css">
.corteUp{
	 border-top: 1px solid #000;
	 margin: 0px 15px 0px 1px;
}
.corteDown{
	 border-bottom: 1px solid #000;
	 margin: 0px 15px 0px 1px;
}

table{
	color: #000;
}

</style>
<html>
    <body>
        <div align="left">COLEGIO CRISTO REY</div>
        <div align="center"><h2><strong>FLUJO DE CAJA DEL <?php echo $fecha;?> </strong></h2></div>
        <br />
        <table width="100%" border="0">
            <tr>
                  <td colspan="5"><h3>RECIBO DE COBRANZA</h3></td>
            </tr>  
            <tr>
                <td class="corteUp corteDown"><strong>TIPO DOC.</strong></td>
                <td class="corteUp corteDown"><strong>NUM. DOC.</strong></td>
                <td class="corteUp corteDown"><strong>COD. ALUM.</strong></td>
                <td class="corteUp corteDown"><strong>ALUMNO</strong></td>
                <td class="corteUp corteDown"><strong>MONTO</strong></td>
            </tr>
            <?php $sum = 0; ?>
            <?php foreach($cobranza as $rows): ?>
            <tr>
                <td><?php echo $rows['ReciboCobranza']['codigo_documento_ref_id']; ?></td>
                <td><?php echo $rows['ReciboCobranza']['numero_documento']; ?></td>
                <td><?php echo $rows['ReciboCobranza']['codigo_alumno']; ?></td>
                <td><?php echo $rows['ReciboCobranza']['alumno']; ?></td>
                <td><?php echo number_format($rows['ReciboCobranza']['abono'],2); $sum +=$rows['ReciboCobranza']['abono'];  ?></td>
            </tr>
            <?php endforeach;?>
              <tr>
                  <td colspan="4" class="corteUp"><strong>TOTAL</strong></td>
                  <td class="corteUp"><strong><?php echo number_format($sum,2); ?></strong></td>
              </tr>  
              <tr>
                  <td colspan="5">&nbsp;</td>
              </tr>  
              <tr>
                  <td colspan="5">&nbsp;</td>
              </tr>  
              <tr>
                  <td colspan="5"><h3>GASTOS</h3></td>
              </tr>  
              <tr>
                <td class="corteUp corteDown"><strong>TIPO DOC.</strong></td>
                <td class="corteUp corteDown"><strong>NUM. DOC.</strong></td>
                <td class="corteUp corteDown"><strong>COD. PROV.</strong></td>
                <td class="corteUp corteDown"><strong>PROVEDOR</strong></td>
                <td class="corteUp corteDown"><strong>MONTO</strong></td>
            </tr>
            <?php $sum = 0; ?>
            <?php foreach($compras as $rows): ?>
            <tr>
                <td><?php echo $rows['DocumentoCompra']['codigo_documento_id']; ?></td>
                <td><?php echo $rows['DocumentoCompra']['numero_documento']; ?></td>
                <td><?php echo $rows['DocumentoCompra']['codigo_proveedor']; ?></td>
                <td><?php echo $rows['DocumentoCompra']['proveedor']; ?></td>
                <td><?php echo number_format($rows['DocumentoCompra']['suma_importe_total'],2); $sum+=$rows['DocumentoCompra']['suma_importe_total']; ?></td>
            </tr>
            <?php endforeach;?>
            <tr>
                <td colspan="4" class="corteUp"><strong>TOTAL</strong></td>
                <td class="corteUp"><strong><?php echo number_format($sum,2); ?></strong></td>
            </tr>  
        </table>
        <br />
        <br />
    </body>
</html>